package com.clouddisk.file.decorator;

import com.clouddisk.file.strategy.FileHandler;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件处理器装饰器基类
 */
public abstract class FileHandlerDecorator implements FileHandler {
    protected final FileHandler fileHandler;

    public FileHandlerDecorator(FileHandler fileHandler) {
        this.fileHandler = fileHandler;
    }

    @Override
    public String getFileType() {
        return fileHandler.getFileType();
    }

    @Override
    public String handleUpload(MultipartFile file) {
        return fileHandler.handleUpload(file);
    }

    @Override
    public byte[] handlePreview(String storagePath) {
        return fileHandler.handlePreview(storagePath);
    }

    @Override
    public boolean isValid(MultipartFile file) {
        return fileHandler.isValid(file);
    }
} 